display: Add display to displaymanager later
authorBenjamin Otte <otte@redhat.com>
Wed, 17 Apr 2013 21:56:22 +0000 (22:56 +0100)
committerBenjamin Otte <otte@redhat.com>
Fri, 19 Apr 2013 20:18:25 +0000 (16:18 -0400)
Instead of GdkDisplay::init, only add the display to the display manager
in GdkDisplay::opened. This avoids spurious changes of the default
display in gtk_init() when we're trying to find the one that works and
try to open lots of different ones.

gdk/gdkdisplay.c

index d8fe13e1d681ecacbc58d7ad883b2fa7350b1305..1c14d3e6174a6769e18975b78ae742cc6db8d135 100644 (file)
@@ -108,6 +108,8 @@ gdk_display_real_opened (GdkDisplay *display)
 
   g_signal_connect (device_manager, "device-removed",
                     G_CALLBACK (device_removed_cb), display);
+
+  _gdk_display_manager_add_display (gdk_display_manager_get (), display);
 }
 
 static void
@@ -206,8 +208,6 @@ gdk_display_init (GdkDisplay *display)
 
   display->multiple_click_info = g_hash_table_new_full (NULL, NULL, NULL,
                                                         (GDestroyNotify) g_free);
-
-  _gdk_display_manager_add_display (gdk_display_manager_get (), display);
 }
 
 static void